package com.test.clyq.entity;

import java.util.Set;

import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import com.test.entity.Item;
import com.test.json.JsonUtil;

/**
 * Users. <br>
 * 用户实体.
 * <p>
 * Copyright: Copyright (c) 2010-4-16 下午05:00:13
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: liuxl@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */

public class Users implements Item {

	/** serialVersionUID */
	private static final long serialVersionUID = 1186537943390L;

	/** 用户权限点集合 */
	private Set<DataPermission> dataPermissionSet;

	/** 是否网站管理员 1是 0否 */
	private Long isUsersAdmin;

	/** 用户地址 */
	private String usersAddress;

	/** 用户描述 */
	private String usersDesc;

	/** 用户EMAIl */
	private String usersEmail;

	/** 用户全名(前台显示使用) */
	private String usersFullName;

	/** 用户标识ID */
	private Long usersId;

	/** 用户登陆名称 */
	private String usersLoginName;

	/** 用户手机号码 */
	private String usersMobile;

	/** 用户密码 */
	private String usersPassword;

	/** 用户电话号码 */
	private String usersPhone;

	/** 用户状态 */
	private Long usersStatus;

	/** 所属网站标识 */
	private Integer usersWebsite;

	public Set<DataPermission> getDataPermissionSet() {
		return dataPermissionSet;
	}

	public Long getId() {
		return this.usersId;
	}

	public Long getIsUsersAdmin() {
		return this.isUsersAdmin;
	}

	public String getUsersAddress() {
		return this.usersAddress;
	}

	public String getUsersDesc() {
		return this.usersDesc;
	}

	public String getUsersEmail() {
		return this.usersEmail;
	}

	public String getUsersFullName() {
		return usersFullName;
	}

	public String getUsersLoginName() {
		return this.usersLoginName;
	}

	public String getUsersMobile() {
		return this.usersMobile;
	}

	public String getUsersPassword() {
		return this.usersPassword;
	}

	public String getUsersPhone() {
		return this.usersPhone;
	}

	public Long getUsersStatus() {
		return this.usersStatus;
	}

	public Integer getUsersWebsite() {
		return usersWebsite;
	}

	public void setDataPermissionSet(Set<DataPermission> dataPermissionSet) {
		this.dataPermissionSet = dataPermissionSet;
	}

	public void setId(Long id) {
		this.usersId = id;
	}

	public void setIsUsersAdmin(Long isUsersAdmin) {
		this.isUsersAdmin = isUsersAdmin;
	}

	public void setUsersAddress(String usersAddress) {
		this.usersAddress = usersAddress;
	}

	public void setUsersDesc(String usersDesc) {
		this.usersDesc = usersDesc;
	}

	public void setUsersEmail(String usersEmail) {
		this.usersEmail = usersEmail;
	}

	public void setUsersFullName(String usersFullName) {
		this.usersFullName = usersFullName;
	}

	public void setUsersLoginName(String usersLoginName) {
		this.usersLoginName = usersLoginName;
	}

	public void setUsersMobile(String usersMobile) {
		this.usersMobile = usersMobile;
	}

	public void setUsersPassword(String usersPassword) {
		this.usersPassword = usersPassword;
	}

	public void setUsersPhone(String usersPhone) {
		this.usersPhone = usersPhone;
	}

	public void setUsersStatus(Long usersStatus) {
		this.usersStatus = usersStatus;
	}

	public void setUsersWebsite(Integer usersWebsite) {
		this.usersWebsite = usersWebsite;
	}

	public String toJSON() {
		return JsonUtil.getJsonStringFromObject(this);
	}

	public String toXML() {
		Document doc = DocumentHelper.createDocument();
		Element root = doc.addElement("items");
		root.addElement("i").addAttribute("n", "主键").setText(String.valueOf(this.usersId != null ? this.usersId : ""));
		root.addElement("i").addAttribute("n", "用户登陆名").setText(this.usersLoginName != null ? this.usersLoginName : "");
		root.addElement("i").addAttribute("n", "用户密码").setText(this.usersPassword != null ? this.usersPassword : "");
		root.addElement("i").addAttribute("n", "用户描述").setText(this.usersDesc != null ? this.usersDesc : "");
		root.addElement("i").addAttribute("n", "用户email").setText(this.usersEmail != null ? this.usersEmail : "");
		root.addElement("i").addAttribute("n", "用户电话号码").setText(this.usersPhone != null ? this.usersPhone : "");
		root.addElement("i").addAttribute("n", "用户手机号码").setText(this.usersMobile != null ? this.usersMobile : "");
		root.addElement("i").addAttribute("n", "用户地址").setText(this.usersAddress != null ? this.usersAddress : "");
		root.addElement("i").addAttribute("n", "是否网站管理员").setText(this.isUsersAdmin != null && this.isUsersAdmin.intValue() == 1 ? "启用" : "禁用");
		root.addElement("i").addAttribute("n", "状态").setText(this.usersStatus != null && this.usersStatus.intValue() == 1 ? "启用" : "禁用");

		return doc.asXML();
	}

}
